package com.qdu.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.qdu.controller.WebSocket;
import com.qdu.mapper.ManagerMapper;
import com.qdu.service.ManagerService;
import com.qdu.service.SocketService;

@Service
public class SocketServiceImpl implements SocketService{
	@Autowired
	ManagerMapper mapper;

	@Autowired
	ManagerService service;
	@Override
	public int totalBussiness() {
		return mapper.totalBussiness();
	}

	@Override
	public int totalUnreviewed() {
		return mapper.totalUnreviewed();
	}

	@Override
	public List<Object> getAllData(String message) {
		
		List<Object> list = new ArrayList<>();
		Map<String,Object> numberMap = new HashMap<>();
		Map<String,String> message1 = new HashMap<>();
	//	if(message1.replace(key, value))
		message1.put("headmessage", message);
		numberMap.put("totalBussiness", totalBussiness());
		numberMap.put("totalUnreviewed", totalUnreviewed());
		list.add(0,numberMap);
		list.add(1,mapper.getUnreviewedList());
		list.add(2,message1);
		return list;
	}

	@Override
	public String sendText(String message) {
		return message;
	}

}
